added directory creation. hackish