better handle empty queue