updated to decode the file path as utf-8 when checking whether the file exists