bug fix and changed save feature