fixes #7
support custom validation functions