Fix issue where restore isn't working sometimes