fixing dirname