Fix redirect handler to actually work