Adding debug for mangle function