add logic for data member in a class