started validator code
changed error design