Replaced while condition + updates
KMS-3488 #time 3h
Code review updates
KMS-3488
Merge pull request #1593 from kaltura/IX-9.19.2-KMS-3488-script-fix2

Replaced while condition + updates