add '__basedir' support