Update README.md

The validation check for the function parameters should perform outside of the function.