added "dirname" to all paths in require methods