add more error handling to app listen