Updated StopTest logic