added logic to the dashboard and routes