Fixed wrong stats query