function onCreated() { clearemptyvars(); // doesn't crash when used here this.test.var = "testing"; echo( this.test.getDynamicVarNames() ); this.test.var = ""; echo( this.test.getDynamicVarNames() ); //clearemptyvars(); // crash's when i swap it to here echo( this.test.getDynamicVarNames() ); }