Fixed onaftersave function reference