Fix dom ready issue