Fix bug when there are no classes when init view.