Fixed the rewrite