be more helpful when encoder is not defined correctly