fix use of dirname on dir already