Fixed formatting and beforeSave signature