Error #1009:Cannot access a property or method of a null object reference

HI,
I have 3 frames on my main time line;
first: has buttons to gotoandstop at frame02 and / frame03
second: has buttons to load external swf files and buton to go to first frame
third: has buttons to load external swf files and buton to go to first frame

when i click on the button on first frame to go to frame 02/03 it works fine.

when i click on home button on frame02/03 at first time it works fine.

but when i again click on the button on first frame and go to frame 02/03 and then again i click on home button it gives error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MS_fla::MainTimeline/frame1()
at flash.display::MovieClip/gotoAndStop()
at MS_fla::MainTimeline/thirdFrame()

when i disable the code on second and third frame error is not shown

can anyone tell what may be the problem?