small tweak to the part of the code that gets the extension