fixed bug when visiting page for very first time and cookie not set