change database engine to innoDB and repair some bugs