Fixing pointer error for setCoordinates()