fix the bug of null inserting