changed jquery key events to on(...) calls