Properly handle transitions