Add distinct to quiery to accurately count