close page if exception is raised.