port checking bugfix