The reason why your lid is lifting during distillation, is the foaming that is disrupting the lid seal.
To avoid this, ensure the lid seal is properly fitted and in good condition and ensure the seal is completely dry before use.
Also, make sure your wash has finished fermenting before distilling it as the unfermented sugars in the wash cause excess foaming.
Another thing to add to reduce the foaming, would be Distilling Conditioner and/or Boil Enhancers.