fixed a bug concerning the distance sensor in the formula editor