new app model
improved error handling