Fixed bug on iPad where wrong directory was written to