fixed dynamic endpoints port calculation