Fixing bug with not existing rewrites