Added control if the class already exists before declaring it.

Apache complained about the class being redeclared.
I added a check to see if the class already exists and it worked like a charm.
It shouldn't harm anyway to leave it there.