fixed too many redirects error