change 'if x in y' with 'if y.get(x,None)'