adds validation to forms