fix inserting bug