dodgey hack to return correct response code if tests fail