fixing db encoding error