fixed saving bugs