Added in main js file save function for fields