they are dieing for a reason. Not seeing or know exactly what you are doing there are many factors that could be involved.
Too much water will drown them.
not enough food.
too hot plastic doesnt breath well and with the sun hitting it during the day it can get too hot for the worms.
not the right types of food......too acidic for the worms is not good.
I use shredded newspaper for bedding wet it till moist. Add top soil and compost.
Make sure if you are adding any compost or manure that it has already been composted. Compost can get hot and kill them when its composting thats why its always best to compost first them feed to the worms after your compost pile has cooled down.
Maybe you can give us more detail as to what you feed them where they are located and more.