Added unified DBG function