move listener removal from forEach