adding toObject from File method