fixes to check_lock