adjusted locking/unlocking of mutex in takeRequest.