correct rubycode from validation