better debug fixes