fixed incorrect call to debug message function