Updated code to match new glitter.js api