Fixed problems when there is no network