add from and to callbacks to states