fixed setting cookie not working