adding animations for state transitions