Fix toggle view bug