saving results to preferences