fix build error and fix bug