Remove old debug variable
Added event handler
Fix #2