replace const with var for ie8 support