Fixed the locks to be faster