added checks when creating transitions