update function.js with setreply