updated script for ReplicaSet configuration