fixed keyboard handling