Close database in listX and save methods.