fixed another bug in getCoordinates