Field is not updated properly by an insert condition