fix keystate opcode bug