Changed return value for message_handler and added ERROR message handling