checking to see if wifi is turned on
fixed several bugs