try config js funcs in block of code as prev. attempt was generating a PurpleRobot not defined