Fix bug whereby toolbar can show in wrong thread