Fix crash in lock feature