fixed dirname issue with test