Fixed a bug, locking the wrong key