fix mime_type detection