make item name query faster with single db query instead of loop