fixed bug with cookie