Fixes bug: active view never changes
Bug fix