fixed type inference errors