Fixed class apply bug