Fix bug appearing when reopening notebook