add transition logic