added the flags for different update/insert