Fix view handling from a poin of  memory management