added saving contracts globally