update app js function