fixed minor bug in ptpd function