added type checking util