Fix login redirect bug