close but no cigar ... fixed bug in dirname