Fix bug with key