Added a proper check for existing config file