fixed dict KeyError