fix missing prototype
fix missing js function rewrite