Chnage view stack's view's index and clean memory