fixed a bug with file handling