better error handling for switching between materials and products