fixed x/y temp reassign bug