fixed bug with checking the cookie value