detect format