Added checkValid