gracefully handle empty queue