update position in db function (in progress)