Add additional error handling for port argument