Replaced dbg function with macro