repair testing code