made savefig to work