fixed a bug where key events were being bound multiple times