throw exception if trying to use a non existing or non writable dir. fix #6