added working file sync and proper handling of filenames with special characters