solve the redirect bug