open and save functionality