new function dir
merged from origin