Bug fixed class choosing