solved problems when creating new instance with same port