fixed cookie and token issue