Fixed threading issue

Synchronize the runPendingRequests