fixed bug when user click on the last class button