Added checks for optmistic concurrency