Issue #13. Added event listeners