fixed bug with add event listeners