add networkavailable check