trying to fix issues with infinite loops and products selection