fix setcookie func