bugfix on function to save all results