Added validity check
Added validity check
Merge pull request #240 from ajstanley/6.x

6.x