edited validate function of classifier