stop executing code after redirect is initiated