avoid redirect twice