Add checking for "pop" in stash function