rewrite handles parse errors now