fix CS and defined $loadEvent variable