fixed the filetype method