save messages in array