fixing buffer save