Closing connection on 5xx errors