updated type matching