Fixed FileOutputStream and refreshing pidList