fix IE9 bugs and add dom ready functionality