added class saving and fixed TBA bug