fix all link and updating selected count on multiple instances