try to make wrap_footer_scripts more clever not to closure function or variable declaration