fixing db update bug