rewrote how to validate config