Fixed issue when creating directory