add replSet checks
remove casting