pname not defined error solved, 'health' keyerror, possibly due to integer field