make tryPort compatible with old code