fix memory leak when add listener to ui object