Fixed issue with directory creation