fixed the problem that inserting and editting did not work