fixed failing to grab keyboard