Implemented weak event pattern to avoid memory leak