Port debug function added