Fixed bug in validator