fix cause of undefined .length in multi-select directive