Close directory after reading in IsRepo