Resolved Unhandled Exception with Scoreboard

The unhandled exception was being generated by the keys() function
because the global data was undefined in result to a new Key asset being
created. I've added a conditional check to see if the global data is
undefined BEFORE checking the length of the global data.