fix if field 'main' is null