Corrected if check for port