fix keyboard handler