Avoid memory leak and unnecessary event binding