fix wifi logic