Added exception handling, deleting messages from queue`