How selfish motives drive people to make dumb mistakes