added app error struct for error handling