fixes

fixed nesting code