fix extension checking. fixes #6