Added flag to choose where sync history is stored