add debug messages when in debug mode