added type checking functions