Now save not only set of states but also goto function.