Fix connection error when require plugin multiple times