fix update and insert