shouldn't have used path.dirname on a directory...