fixing test error handlin