fixed type errors hopefully