class selection nearly working properly