validate is an internal method