Help! I am trying to bind teleports between rooms

I am trying to bind doors between rooms but for a reason unknown to me the length of doors per room decreases sometimes without me ever changing the arrays length

pictures: