fixed some bugs in classification