add __dirname support