fixed ERR_TOO_MANY_REDIRECTS