better detection of file extensions