Modified code to new PyBossa