fix location redirecting