Bind error hander before even loading the page.