Adding a lock to get a atomic attending of requests