Add debug functions