Revert "funzione flatten object"

This reverts commit 59313df346ccfa54db29671c7ab6b8ed9161c0fa.
fixed for firefox