sync method for persistence