added valdiation
Merge pull request #49 from jcgharvey/validateBeforeSending

added valdiation