Bug fixed in checkActiveReplicas()