Added some debug code that for some reason makes the code not get stuck when starting in light mode