Fxing some JSON serialization error when unloacking a document that resulted in a js error which prevented the reload of the page