fixes a redirect problem from oauth