fix bug with saving empty lists and dictionaries