more error checking for ontestcomplete