added instance saving