added method to resume for saving data