Fix dictionary key missing error