Fixing 502 errors