added more functionality to lock