fixed _generate_scheme error