fixed a type checking problem