Added active class handling in the main view