Fix to prevent thread conflict.