fixed bug with long filenames