added basedir support