added a validator

closes #13