use generic approach to detect if we removed the end of our queue