fixing key binding code