fix 302 redirect problem