corrected order of push/pop

popping and then pushing causes an error because there's nothing on the stack to pop