fixed bugs in validators and main script