fix type inference