fix bugs that insert into mysql