fix bug parsing cookie