use constaraints for switch element