The best way to prevent this is to use a pastry brush and water to brush down the insides of the pan where sugar may harden. This way, the candy glass has the chance to transform back into a solid the correct way. Make sure your tools are clean and dry when using them to cook your candy.