fix bug: write avaiable.txt with '\n'