error checking, type checking