Fixed bug when dismiss view with ViewWillAppear