fixed the test_refine