Fixed error in add class code.