Unhappiness may lead to bad choices, study