fix for undefined cookie