fix keyboard bugs