fixed port bugs