more defensive check for extension