resolve an ordering issue with postgres states; correctly convert true to the javascript keyword instead of python's True