A note on the cobordism invariance of the index