fix type check