fixed error handling in config.c