fixed bug with cookies