fixed negative coordinate bug