replaced basedir with another method for compatibility with Windows