fixing validation funcitons