bug fix in cookie behavior