made directory creation optional