Melting the butter and marshmallows at a high heat is usually the reason for this. Make sure you keep it on low-medium heat.