set hard limit on calculation time in distance calc, close unused query connection in sensors