added dirname to requireonce