fix unsafe factory