If I place val() as first argument to eq() function it works great. Is there any reason it behaves this way? @MichelDiz