added __dirname
added __dirname