fixed template bug in generate_controller