added logic to redirect if trying to access account pages without session