Fix custom port issue

Fixes issue where port other than 80 or 443 is explicitly used