Adding function update to javascript file