added keyboard check