fixed file type extraction