fix type checks