try to fix the way we find $topdir