fixed a bug in the textfile helper