Fixed the implementation of click to block until the page is loaded