Fixed login redirect bug