Keyframe with timeline colapsed or expanded.

Hello everyone,
I do have a question that bothers me a little.
I want to put a keyframe on a peg where there are another peg under it and a drawing layer under that. Having the timeline colapsed (so you only see the first peg in timeline) when I keyframe it puts keyframes also on the layers inside that peg. When the timeline is expanded it only puts keyframe on the current layer. Is there a way (or a setting) where with timeline collapsed when I put a keyframe on a peg it does not put keyframes also on the layers inside that peg? (like when expanded).

Thank you very much!!!