Add config validation #1

but i want to set default value for config
Add some method
merge head