Infinite lines in geomap route option

I am using grafana 10.3.3 with geomap plugin version 5.0. I am trying to draw bus routes using the beta routes function. The data table to draw the line is in mysql and has geohashes for the bus lines. The map is created by several independent layers. Each layer is a bus line with its corresponding mysql query to return all geohash points and draw the route line. Everything is fine, but when I get to draw the last point of the route, geomap adds an infinite line. What is the reason and how can I solve it?