Add try-catch to putModifiedObject