error handling at app controller