Updated to work better with IE 10