Fix factory (sometimes it could random material and fail tests)