fix bug: redirect twice