Added debug code for 502s