fixed bug that was causing WrongExpectedVersionException to be thrown