fix cannot open class bug.
(cherry picked from commit 5dc3705)