add debugging codes