add save functionality to modal