add JS function object creation (not working yet)