Fixed a bug in popToRootViewController