Fixing the rewrite policies using proper if_() statement