cast messages to array