Adding getPort method to URL