rewrite code to fix code dump