Animals must contend with an ever-changing environment. Social animals, especially eusocial insects such as ants and bees, rely heavily on communication for their success. However, in a changing environment, communicated information can become rapidly outdated. This is a particular problem for pheromone trail using ants, as once deposited pheromones cannot be removed. Here, we study the response of ant foragers to an environmental change. Ants were trained to one feeder location, and the feeder was then moved to a different location. We found that ants responded to an environmental change by strongly upregulating pheromone deposition immediately after experiencing the change. This may help maintain the colony's foraging flexibility, and allow multiple food locations to be exploited simultaneously. Our treatment also caused uncertainty in the foragers, by making their memories less reliable. Ants which had made an error but eventually found the food source upregulated pheromone deposition when returning to the nest. Intriguingly, ants on their way towards the food source downregulated pheromone deposition if they were going to make an error. This may suggest that individual ants can measure the reliability of their own memories and respond appropriately.