add if statement for class redeclaration