fix error redirect