isOnTheLine added and adaptation