removing global __dirname variable