correctly handling original filename