fixed directory creation bug