Fixed bug with cookie