Correction of method of validate.rb