improved saving local parameters