debug log
fix lockcode handling for pg