Fixed bug in pop