IIRC, the these local functions need to have the 'local' keyword