fix for cookie code