fix bugs about forgetting to new a class