added presave callback