Added debug function.