fix error in db statement