fixed a bug where negative coordinates were incorrectly saved