fixed recursive funciton calls for structs