add close() method to exported api