refactor/update: added logic for index controller to redirect to profile page if user logged in