fixed class matching bugs