changed popback to simply pop with a flag