Added encode property, corresponding with #238 issue