Fix undefined object error on IE