Fixed crash issue due to nil values in a dict