Added cookie check