add class to master when hidden