fix bug on cookie