add a bunch code to support ie8