update position on change of x or y