included validate function