Added check to prevent guests accessing the dashboard