Add a class to avoid resource leak, but have not tested yet