rewrite resource files