fix the context issue when using @synchronize