fixed up extension checking into a function