a fix for the strange case of overflow x/y