Fixing bug when trying to access the dashboard