Fixed error propagation and added write concerns on update