code example didn't wark proper. added stopPropagation to event