Adding a condition to transitions