added some network error handeling