fix generating type validator