fixing key detection bits