fixed directory creation stuff