added type checking step