Fix to add directory creation