Fix redirect behavior