hw7 fixed redirect problem