Issue accessing a dictionary key in python