check network at begin