handle basedir