fixed bug where pop() was skipping rows