more error handling, better app control