added error handling on reading config file