rewrite unit test