Modified the save as draft function

Modified the function.js file