fix problem with multiplication of event listeners