stupid hack to avoid crash when avail is <= 0