factory() : infinite call loop fixed