fix factory as closure