@Dave @zachary @zach I'm not sure which is causing the bug but it's indeed happening
EDIT: Sending hex over serial was causing the issue. The HEX values probably got recognized as HID commands
Serial.print(a[j], HEX);