appended saving feature to js file