correctly return app state to front end