end function if tab key pressed