added debug info if debug is enabled