Add internet check function to some functions that requires network
connection