add debug logic to server