fixed avail mem leak