will raise an exception if no filetype found