fixed to handle applicationDataDirectory and its nativepath