add debug functions