Utilities.js undefined fix

Error-checking for undefined