Added fix for domLoaded state.