Better handling of empty queue