fix method called on wrong thread