debug switch now working