fix sample viewer toggle bug