switch msg.cmd to msg.type for consistency