[LIBCLOUD-587] fix logic