Bug fix with key listeners