fix bug:write avaiable.txt with append mode