fixing dirpath function - fixes #30
Merge pull request #31 from ptica/patch-1

fixing dirpath function - fixes #30