Using correct variable to test for dashlet existence.  Better conditional logic.  Fixes #8246