Fixed a scope issue with IE 8