App: add proper error handling