adding conditional constraints