fixed bug with removeEventListener