restore functionality bug fix