added validation and test for where clause. closes #6