Adding file type detection