model modify and fix bugs