Fix unbound attrobute when several instance of the code completion mode are created