fix the query of products with users
clean the code