change basename to dirname

`base` is directory, it is not `basename`