fixed type mismatch errors