fix bug on one to many generated input