change server_state definition to resolve key error and add debug
statements