update debug function
convert jid to lowercase