add some error handlings when swf managing