Change the way we get info from dict to avoid KeyError