improved error handling on startup