Fixing the logic of rising exceptions when iterating through the stores