Fixed bug with transitions