make defined structs can encodeable