undefined check added for console object in ie9