added type check precondition