code fixed for ie8 and ie9