added boolean portIndexFound