fixed cookie saving