Fix for ending remote queue when waiting for messages