fixed small logic error with structs inside struct