#58 added rewrite