added error handling to config loader