add function to process message