now to add save functionality