fix port nil issue