fixed pop on empty list