fixing the generator