CLOUD-322 fixed logical mistake