fix type checking