fixes cookie checking