Setting up the leave transition