fixed leaving class issue