Moved mutex.Lock() outside the request context check