improve config validation