Added handling of messages for queue