Fixed login header redirect bug on error