adjustments on before and after save functions