throw exception on invalid message recieved