Add two way binding on switchActive
Add back $apply with more check