handle nest level properly when parsing nested blocks