add debug code to server