fixed private variables set in constructor for encoding