Oops… never mind… the problem was in the constructor… when I used this.swap(id), then it’s fine.
this.swap(id)