added code to load object from file