fixed x-y bug