Fix for the redirection bug