fix bug in generator controller