add and modified logic