handles network problems