handling loading bar where request fails