Updating code for WiFly support