add debug output to see what is written to frontend