added a couple of line to prevent error

@cReedHranac This should fix the error you were getting. The cell directly above the one that had the error was creating a new dictionary named "record" that doesn't have "count" as a key. I'm not exactly sure what you want to do here, however you could name the new dictionary something else, or reload the original dictionary like I did in the code.