change private method to protected, hack for encoding