Updated code for dashboard