add if conditions to transition