fix bug in populate brand sql