now I can sleep at night. caught the correct exception for ports