add savedir support