Added support for CustomAppState