fixed a redifrect bug