fixed #1058, clearVariables before redirect
Merge pull request #1065 from garciademarina/issue-1058

Issue 1058 fixed