Used setCoordinate instead of directly setting the coordinate variable