fixing dirname flag