Revert "Allow configuration of return_to"

This reverts commit 5893d8e155e48457984fa6a6d3f73e3c382b538d.
Revert "Make pop safe"

This reverts commit 5959c587b889467c0c6e7e1a18ec0ecd115283af.
Swapped order of checks to prevent looping issue