implementing the missing locks