add logic and