changed save method