fix error which caused incorrect output in case wifi was unavailable