added custom preserver function