We do good things just to make sure we have fate on our side, says a new study. And it is especially true when we are waiting for an important outcome.

Researchers call this phenomenon of doing good things at the last moment as "investing in good karma."

The present study found that people are more likely to donate or help out if they believe that the outcome of a situation is out of their control.

The research results are based on a series of experiments. In all experiments, researchers prepped volunteers by asking them to think about an outcome that is out of their control (a new job, pregnancy outcome, medical test report) while another set weren't prepped and acted as controls.

In every experiment, people who thought about an unresolved and uncontrollable situation were more likely to donate to charities or help out other people. Researchers designed the experiments in such a way that participants volunteered for good deeds for the sake of "investing in karma" rather than doing it for distraction or for being more agreeable.

"Everyone is familiar with the basics of reciprocity, the idea that if you scratch my back, I'll scratch yours. We wondered if people think this way even when they aren't dealing with another person at all, but rather with the universe," said Benjamin Converse, Assistant Professor of Public Policy and Psychology at the University of Virginia and one of the researchers.

The idea that everybody follows, even if they don't believe, is that good things happen to good people. So people try and be good till the last possible moment (especially at the last possible moment) just to please the "universe."

Also, people who bargained with the universe by doing good deeds were more optimistic about future outcomes. Researchers say that the experiment results were a bit surprising because the assumption is always that when people become selfish when they want something, but it turns out that we are more ready to help others when we want the universe to give us something.

"You might expect that people would be more selfish when thinking about the things in life that they want, but that are beyond their control. But we found that this experience makes them more likely to reach out and help, at least when they are given the opportunity to do so," said Converse.

"Even if people don't actually believe in karma, they may still have an intuitive sense that good things happen to good people. If that intuition moves us to donate to a good cause and makes us a little more optimistic in the meantime, that seems like a good thing," the researchers said.

The same strategy is used whether it is to please the universe or people. As one study says, major corporations start spending more on charities during a disaster when they themselves might be affected by losses due to adverse market conditions (plunging stocks). Researchers in this study argue that these corporations tend to donate more at times of disasters (like Hurricane Katrina) to offset their prior "bad deeds" and to appear as socially responsible even when donating doesn't make good business sense.

Other studies say that knowing that we have done good things in the past can have a kind of liberating effect that can at times make us feel less guilty about being immoral or unethical.

The study was published in the journal Psychological Science.