What? o_O You should it to true before the loop and change to false if statement (status != Status::Offline && a->status() == Status::Offline) is satisfied