Try to enable masterswitch before dismissing dialog