Add debug mechanism