close the loading view on error