Fix e.keypress being called when it does not exist