Implemented the passcode lock with handling resuming