modify setCookie method