bug fix for debug mode