keyup and keydown functions added