fixing reference issue in debug class