resolved rewriting bug