add handlers for messages