Fix issue with directory creation