patch for bug with IE 6/8 thanks to Nick