handling the case when the page dom loaded before the client library
is loaded.