added more error checking for configuration file