fix keyboard check issue