add fragment switched listener