fixing save properties function