pass bool value to encode