fix login redirect bug