URL cleanup should probably happen regardless, so this should be outside of the if statement.