fix bug when temporal layer changes
Merge pull request #1129 from ruil2/temporal_bug_fixv1.1

fix bug when temporal layer changes