add log for switch frame function