fix issue when the initial viewController is not the first in the stack