Added function to sonata-utils.js