Adding onCreate() and onDestroy() callbacks to states