I was looping over the extensions the wrong way around