mods to clear_lock