corrected validate and updated tests