make save button work