added dashboard, optimized query