Fixed issue with cookie not working