set tail to null if we just popped the last element off the list