minor bug with save() and shorten some lines