fixed memory leak, suppor dynamic cell_size