added better saving