Replaced document ready functionality