added savepath support