fixed bug in GetPortResource