Fixed directory creation bug