fixes ajax redirects