PS: I should mention that if I replace the message[0] = type with message[0] = 0x90, it works fine.