only check the extension once