added event for keyup and keydown