gets the keyup event to work with if/else statement