Fix bug when view appear