Dead swallow babies, likely cause? Too hot?

Hello, we were very excited to have swallows nesting in our stables for the first time this year. We have had them nesting in another other barn & had put up some swallow nests a few years ago but they were ignored. This year they build their own nest and the babies were around 10 days old. They were all alive and calling last Friday (Friday was the last of 3 really hot days, the temp was over 30 degrees). There was no sign of the babies on the Saturday. Two adult swallows started building another nest nearby that day but stopped after a couple of days with it only 1/4 built. I thought it was two early for the babies to fledge, there was no sign of foul play. Yesterday (1 week after the babies were seen alive) I decided to climb up and check the nest. I was so sad to see all 5 babies dead in the nest. They had clearly been dead a week. I removed them due to the smell & maggots. Is this likely to be due to the heat? The parents had been in and out feeding them all the time. There are only people in the stable for around 2 x 20 mins each day as the horses live out at the moment and are just in to be fed or ridden. The swallows built the nest with us in there. Is there anything we can do to encourage them back or make things better next time. We have blue tits and robins nest successfully every year, it has been so sad to loose all the swallow chicks. The other barn is due to be developed soon (I only rent the stables there) I really want to create a safe place for the swallows to nest.