adding scripts to pages and fixing inheritance for js