Added a check on the error return code of the wifi scanner.