Added debug code to investigate problems with IE