fixed a bug so that writeFlag is properly deterined with the listfinder