fixing code gen

create from prototype, not from constructor