made sure only valid data enters databes