New, tested version of the pledge handler