Added js global js collecting arrays, moved check_page_security call