It works until for some reason i get one key and I can unlock every door.
Tell me how you made the key function please